<template>
    <div>
        <div>{{ $route.meta.title }}</div>
        <div>{{ $route.params }}</div>
        <button @click="goReplace">goReplace</button>
    </div>
</template>
<script>
export default {
    beforeRouteEnter(to, from, next) {
        console.log('beforeRouteEnter', to);
        console.log('beforeRouteEnter', from);
        next();
    },
    beforeRouteUpdate(to, from, next) {
        console.log('beforeRouteUpdate', to);
        console.log('beforeRouteUpdate', from);
        next();
    },
    beforeRouteLeave(to, from, next) {
        console.log('beforeRouteLeave', to);
        console.log('beforeRouteLeave', from);
        next();
    },
    methods: {
        goReplace() {
            this.$router.replace({
                name: 'params',
                params: {
                    id1: 'ccc',
                    id2: 'ddd'
                }
            });
        }
    }
}
</script>
<style></style>